﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="lib/html5.js"></script>
    <script type="text/javascript" src="lib/respond.min.js"></script>
    <script type="text/javascript" src="lib/PIE_IE678.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="lib/Hui-iconfont/1.0.7/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="lib/icheck/icheck.css" />
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="static/h-ui.admin/css/style.css" />
    <!--[if IE 6]>
    <script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>审核列表</title>
</head>
<body>
    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 审核列表 <span class="c-gray en">&gt;</span> 审核列表详情 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
    <div class="page-container">
        <div class="cl pd-5 bg-1 bk-gray mt-20">
            <span class="l">
                <input type="text" name="" id="number_Search" placeholder="请输入报告编号查询" style="width:250px" class="input-text">
                <button name="" id="" class="btn btn-success" type="button" onclick="search()"><i class="Hui-iconfont">&#xe665;</i> 查询</button>
            </span>
            <span class="r">共有数据：<strong id="count">0</strong> 条</span>
        </div>
        <div class="mt-20">
            <table class="table table-border table-bordered table-bg table-hover table-sort">
                <thead>
                    <tr class="text-c">
                        <th width="100">项目号</th>
                        <th width="40">申请人</th>
                        <th width="40">勘察员</th>
                        <th width="40">估价员</th>
                        <th width="100">房屋坐落</th>
                        <th width="30">建筑面积</th>
                        <th width="50">评估单价</th>
                        <th width="90">评估总值</th>
                        <th width="70">状态</th>
                        <th width="80">操作</th>
                    </tr>
                </thead>
                <tbody id="mybody">
                    <!--完成-->
                    <tr class="text-c">
                        <td>201600001</td>
                        <td>张三</td>
                        <td>1356456456</td>
                        <td>王萨德</td>
                        <td>320㎡</td>
                        <td>150㎡</td>
                        <td>320K</td>
                        <td>评估完成</td>
                        <td class="f-14 td-manage">
                            <input type="button" class="btn btn-primary radius" value="初审" onclick="firstTrial()" />
                            <input type="button" class="btn btn-primary radius" value="终审" onclick="lastInstance()" />
                        </td>
                    </tr>
                    <!--待完善-->
                    <tr class="text-c">
                        <td>201600002</td>
                        <td>李四</td>
                        <td>1356456456</td>
                        <td>王萨德</td>
                        <td>320㎡</td>
                        <td>150㎡</td>
                        <td>320K</td>
                        <td>正在评估</td>
                        <td class="f-14 td-manage">
                            <a title="导出抵押物初审意见书" href="javascript:;" onclick="Initia_laudit(201600002)" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe640;</i></a>
                            <a title="导出公积金贷款二手房担保方式正式报告" href="javascript:;" onclick="Formal_audit(201600001)" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6ba;</i></a>
                             </td>
                    </tr>
                    <!--<tr class="text-c">
                        <td>201600002</td>
                        <td>李四</td>
                        <td>1356456456</td>
                        <td>王萨德</td>
                        <td>320㎡</td>
                        <td>150㎡</td>
                        <td>320K</td>
                        <td>正在评估</td>
                        <td class="f-14 td-manage">
                            <a title="导出抵押物初审意见书" href="javascript:;" onclick="Initia_laudit(201600002)" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe640;</i></a>
                            <a title="导出公积金贷款二手房担保方式正式报告" href="javascript:;" onclick="Formal_audit(201600001)" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6ba;</i></a>
                        </td>
                    </tr>-->
                </tbody>
            </table>
        </div>
    </div>
    <!--模态框-->
    <script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="lib/layer/2.1/layer.js"></script>
    <!--<script type="text/javascript" src="lib/My97DatePicker/WdatePicker.js"></script>-->
    <!-- <script type="text/javascript" src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>-->  <!--分页脚本，暂时注释-->
    <script type="text/javascript" src="static/h-ui/js/H-ui.js"></script>
    <script type="text/javascript" src="static/h-ui.admin/js/H-ui.admin.js"></script>
    <!--域名配置-->
    <script type="text/javascript" src="static/WebApi.js"></script>
    <script type="text/javascript">

        var StateList = Array();

        /*估价信息-显示*/
        $(function () {
            
            getStateList();//获取枚举定义的状态
            examinationShow();//显示审核列表（根据报告编号查询）

        });

        //查询函数-根据报告编号
        function search()
        {
            var P_ReportNumber=$("#number_Search").val();
            examinationShow(P_ReportNumber);//显示审核列表（根据报告编号查询）
        }

        //显示审核列表（根据报告编号查询）
        function examinationShow(P_ReportNumber)
        {
            $.ajax({
                type: "post",
                url: ApiUrl + "api/trackRecord/examinationSelect",
                data: { "": P_ReportNumber},
                success: function (data) {
                    $("#mybody").empty();
                    var html = Array("");
                    $(data).each(function () {
                        var P_state=StateList[this.P_state];
                       html.push('<tr class="text-c">');
                       html.push('<td>'+this.P_ReportNumber+'</td>');
                       html.push('<td>'+this.B_name+'</td>');
                       html.push('<td>'+this.B_phone+'</td>');
                       html.push('<td>王萨德</td>');
                       html.push('<td>320㎡</td>');
                       html.push('<td>150㎡</td>');
                       html.push('<td>320K</td>');
                       html.push('<td>'+P_state+'</td>');
                       html.push('<td class="f-14 td-manage">');
                       if (this.P_state == 6 || this.P_state == 5)
                       {
                           html.push('<input title="导出抵押物初审意见书" type="button" class="btn btn-primary radius" value="导出初审意见书" onclick="download_Initia_laudit(' + this.P_ReportNumber + ')" />');
                           html.push('<input type="button" class="btn radius btn-primary" onClick="lastInstance(\'终审\', \'lastAudit.html\', \'' + this.P_ReportNumber + '\',\'800\', \'500\')" value="终审" />');
                       }
                       else if (this.P_state == 7)
                       {
                           html.push('<input title="导出抵押物初审意见书" type="button" class="btn btn-primary radius" value="导出初审意见书" onclick="download_Initia_laudit(' + this.P_ReportNumber + ')" />');
                           html.push('<input title="导出公积金贷款二手房担保方式正式报告" type="button" class="btn btn-primary radius" value="导出正式报告" onclick="download_Formal_audit(' + this.P_ReportNumber + ')" />');
                       }
                       else
                       {
                           html.push('<input type="button" class="btn btn-primary radius" value="初审" onclick="firstTrial(\'初审\', \'firstAudit.html\', \'' + this.P_ReportNumber + '\',\'800\', \'500\')" />');
                           html.push('<input type="button" class="btn radius btn-primary" onClick="lastInstance(\'终审\', \'lastAudit.html\', \'' + this.P_ReportNumber + '\',\'800\', \'500\')" value="终审" />');
                       }
                       html.push('</td>');
                       html.push('</tr>');
                    });
                    $("#mybody").append(html.join(""));
                },
                error: function () {
                    layer.msg("ajax加载员工信息时出错！", { icon: 2, time: 1000 });
                }
            });
        };

        //获取枚举定义的状态
        function getStateList() {
            $.ajax({
                type: "post",
                url: ApiUrl + "api/trackRecord/GetSelectState",
                async: false,
                success: function (data) {
                    $(data).each(function () {
                        StateList[this.value] = this.text;
                    })
                },
                error: function (e) {
                    parent.layer.msg('网络链接超时...!', { icon: 2, time: 1000 });
                }
            });
        };

        ///*导出抵押物初审意见书*/
        //function download_Initia_laudit(P_ReportNumber)
        //{
        //    $.ajax({
        //        url: ApiUrl + "api/Examination/Thetrial",
        //        type: 'post',
        //        data: { "": P_ReportNumber },
        //        success:function(data)
        //        {
        //            parent.layer.msg("导出成功！", { icon: 1, time: 1000 });
        //            location.href =""+ ApiUrl +data;
        //        },
        //        error:function()
        //        {
        //            parent.layer.msg("ajax执行生成文件时报错！", { icon: 2, time: 1000 });
        //        }
        //    });
        //    //location.href=''
        //}

        ///*导出公积金贷款二手房担保方式正式报告*/
        //function download_Formal_audit(P_ReportNumber) {
        //    $.ajax({
        //        url: ApiUrl + "api/Examination/lastAudit",
        //        type: 'post',
        //        data: { "": P_ReportNumber },
        //        success: function (data) {
        //            parent.layer.msg("导出成功！", { icon: 1, time: 1000 });
        //            location.href = "" + ApiUrl + data;
        //        },
        //        error: function () {
        //            parent.layer.msg("ajax执行生成文件时报错！", { icon: 2, time: 1000 });
        //        }
        //    });
        //    //location.href=''
        //}

        /*房产抵押基本信息-删除-未预约勘查信息之前可以删除*/
        function pledge_del(obj, id) {
            layer.confirm('确认要删除吗？', function (index) {
                $(obj).parents("tr").remove();
                layer.msg('已删除!', { icon: 1, time: 1000 });
            });
        }


        //弹出初审页面
        function firstTrial(title,url, id, w, h) {
                url=url+"?"+id;
                layer_show(title,url, w, h);
            }
        
        //弹出终审页面
        function lastInstance(title, url, id, w, h) {
            url=url+"?"+id;
            layer_show(title,url, w, h);
        }
        


    </script>
</body>
</html>




